package com.jmb.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

/**
 * 
 * @TableName t_rely_data
 */
@TableName(value ="t_rely_data")
@Data
public class RelyData extends BaseEntity{

    /**
     * 依赖名称
     */
    @Schema(description = "依赖名称")
    @NotNull(message = "依赖名称不允许为空")
    @NotEmpty(message = "依赖名称不允许为空")
    @Size(min = 1, max = 100, message = "依赖名称长度必须为[1,100]")
    @Pattern(regexp = "\\w+", message = "依赖名称必须为字母数字下划线")
    @TableField(value = "name")
    private String name;

    /**
     * 依赖值
     */
    @Schema(description = "依赖值")
    @NotNull(message = "固定值/方法声明/SQL不允许为空")
    @NotEmpty(message = "固定值/方法声明/SQL不允许为空")
    @TableField(value = "value")
    private String value;

    /**
     * 依赖描述
     */
    @Schema(description = "依赖描述")
    @NotNull(message = "依赖描述不允许为空")
    @NotEmpty(message = "依赖描述不允许为空")
    @Size(min = 1, max = 200, message = "依赖描述长度必须为[1,200]")
    @TableField(value = "description")
    private String description;

    /**
     * 依赖类型 0固定值 1反射方法 2sql-select 3sql-insert 4sql-update 5sql-delete 6sql-script
     */
    @Schema(description = "依赖类型 0固定值 1反射方法 2sql-select 3sql-insert 4sql-update 5sql-delete 6sql-script")
    @NotNull(message = "类型不允许为空")
    @TableField(value = "type")
    private Integer type;

    /**
     * 数据源id
     */
    @Schema(description = "数据源id")
    @TableField(value = "datasource_id")
    private Integer datasourceId;



    /**
     * 0是1否当type=3（新增）时，是否返回自增主键
     */
    @Schema(description = "0是1否当type=3（新增）时，是否返回自增主键")
    @TableField(value = "enable_return")
    private Integer enableReturn;

    /**
     * 0是1否当type<2时，是否解析sql中的依赖
     */
    @Schema(description = "0是1否当type<2时，是否解析sql中的依赖")
    @TableField(value = "analysis_rely")
    private Integer analysisRely;

    /**
     * 创建人用户编号
     */
    @Schema(description = "创建人用户编号")
    @TableField(value = "creator_id")
    private Integer creatorId;

    /**
     * 创建人用户昵称
     */
    @Schema(description = "创建人用户昵称")
    @TableField(value = "creator_name")
    private String creatorName;

    /**
     * 非创建人能否删除0是1否
     */
    @Schema(description = "非创建人能否删除0是1否")
    @TableField(value = "others_deletable")
    private Integer othersDeletable;

    /**
     * 非创建人能否修改0是1否
     */
    @Schema(description = "非创建人能否修改0是1否")
    @TableField(value = "others_modifiable")
    private Integer othersModifiable;
}